import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
import InsertView from "@/views/film/InsertView.vue";

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        redirect: '/homepage',
        children: [
            {path: '/homepage', component: () => import('../views/home/HomePageView.vue')},
            {path: 'center', component: () => import('../views/home/PersonalCenterView.vue')},
            {path: '/employee', component: () => import('@/views/user/EmployeeView.vue')},
            {path: '/user', component: () => import('@/views/user/UserView.vue')},
            {path: '/dict', component: () => import('../views/dict/DictView.vue')},
            {path: '/dictOption', component: () => import('../views/dict/DictOptionView.vue')},
            {path: '/film', component: () => import('../views/film/FilmView.vue')},
            {path: '/subject', component: () => import('../views/film/FilmSubjectView.vue')},
            {path: '/filmSubject', component: () => import('../views/film/FilmSubjectParticularsView.vue')},
            {path: '/director', component: () => import('../views/film/DirectorView.vue')},
            {path: '/actor', component: () => import('../views/film/ActorView.vue')},
            {path: '/details', component: () => import('../views/film/FilmDetailsView.vue')},
            {path: '/carouselMap', component: () => import('../views/web/CarouselMapView.vue')},
            {path: '/homeMovie', component: () => import('../views/web/HomeMovieShowView.vue')},
            {path: '/homeSubject', component: () => import('../views/web/HomeSubjectShowView.vue')},
            {path: '/homePreview', component: () => import('../views/web/HomePreviewView.vue')},
            {path: '/comments', component: () => import('../views/web/CommentsView.vue')}
        ]
    },
    {
        path: '/insert',
        component: InsertView,
        redirect: '/insert/first',
        children: [
            {path: '/insert/first', component: () => import('../views/film/step/StepOneContent.vue')},
            {path: '/insert/second', component: () => import('../views/film/step/StepTwoContent.vue')},
            {path: '/insert/third', component: () => import('../views/film/step/StepThreeContent.vue')},
            {path: '/insert/success', component: () => import('../views/film/step/StepSuccessContent.vue')},
        ]
    },
    {path: '/login', component: () => import('../views/LoginView')}
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
